<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * Class CreateMedicalPersonalhistoryTable
 * 个人史数据库
 */
class CreateMedicalPersonalhistoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('st_medical_personalhistory', function (Blueprint $table) {
            $table->increments('id')->comment("病历个人史数据库");
            $table->unsignedInteger('record_id')->index()->comment("关联medical_records_id");
            $table->text('smoke')->nullable()->comment("吸烟情况");
            $table->text('stop_smoke')->nullable()->comment("戒烟情况");
            $table->text('drink')->nullable()->comment("饮酒情况");
            $table->text("stop_drink")->nullable()->comment("戒酒情况");
            $table->string('remark')->default('')->comment('备注');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('st_medical_personalhistory');
    }
}
